package com.cargroup.service;

import com.cargroup.bean.Car;
import com.cargroup.dao.CarMapper;
import org.apache.jasper.tagplugins.jstl.core.Out;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarService {
    @Autowired
    private CarMapper carMapper;

    public List<Car> getallcar() {
        List<Car> cars = carMapper.getall();
        return cars;
    }

    public void editCar(Car car) {

        carMapper.editCar(car);
    }

    public int deleteCar(Integer id) {
        return carMapper.deleteCar(id);
    }

    public void insertCar(Car car) {
        carMapper.insertCar(car);
    }

	public Car getCar(Integer id) {
		// TODO Auto-generated method stub
		return carMapper.getCar(id);
	}

	public void changeState(Integer id) {
		// TODO Auto-generated method stub
		 carMapper.changeState(id);
	}

}
